/*
 * @Author: Simon 1958058172@qq.com
 * @Date: 2025-08-07 11:19:56
 * @LastEditors: Simon 1958058172@qq.com
 * @LastEditTime: 2025-08-07 14:25:07
 * @FilePath: \java.1212\csdn\baozhuang\li04\Test.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package csdn.baozhuang.li04;

public class Test {
    public static void main(String[] args) {
        Student s1=new Student("张三",20);
        Student s2=new Student("张三",20);

        //System.out.println(s1.equals(s2));//false
        System.out.println(s1==s2);//false
        //如果想判断s1和s2内的值是否相等，需要重写equals方法
        //重写后
        System.out.println(s1.equals(s2));//true

        System.out.println(System.identityHashCode(s1));//523429237
        System.out.println(System.identityHashCode(s2));//664740647----不同

    }
}
